package entity

import (
	"time"
)

// UserRole [...]
type UserRole struct {
	ID        uint64    `gorm:"primaryKey;column:id" json:"-"`
	CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"`
	UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"`
	UserID    uint64    `gorm:"column:user_id" json:"userId"`
	RoleID    uint64    `gorm:"column:role_id" json:"roleId"`
}

// TableName get sql table name.获取数据库表名
func (m *UserRole) TableName() string {
	return "user_role"
}

// UserRoleColumns get sql column name.获取数据库列名
var UserRoleColumns = struct {
	ID        string
	CreatedAt string
	UpdatedAt string
	UserID    string
	RoleID    string
}{
	ID:        "id",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	UserID:    "user_id",
	RoleID:    "role_id",
}
